<?php
function smarty_block_sql($params, $content, &$smarty)
{
    if(empty($content))return;
    // print_r($params);exit;
    $sql=$params['tiaojian'];
    $data=query($sql);
    foreach ($data as $d) {
        $d['sex']=$d['sex']==1?'男':'女';
        $tmp=$content;
       foreach ($d as $key => $value) {
          $tmp=str_replace('[$field.'.$key.']', $value, $tmp);
       }
       echo $tmp;
    }
}

/* vim: set expandtab: */

?>
